import { SET_POSITION } from '../constants/common'

const INITIAL_STATE = {
  positionInfo: {
    city: '',
    description: '',
    latitude: '',
    longitude: ''
  }
}

export default function common (state = INITIAL_STATE, action) {
  switch (action.type) {
    case SET_POSITION:
      console.log('payload', action.payload.positionInfo)
      return {
        ...state,
        positionInfo: action.payload.positionInfo
      }
     default:
       return state
  }
}
